Optimal. Leaf size=77 \[ \frac {a^2 \log (\cosh (c+d x))}{d}+\frac {a (a-2 b) \text {sech}^2(c+d x)}{2 d}+\frac {(2 a-b) b \text {sech}^4(c+d x)}{4 d}+\frac {b^2 \text {sech}^6(c+d x)}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {4223, 457, 77}
\begin {gather*} \frac {a^2 \log (\cosh (c+d x))}{d}+\frac {b (2 a-b) \text {sech}^4(c+d x)}{4 d}+\frac {a (a-2 b) \text {sech}^2(c+d x)}{2 d}+\frac {b^2 \text {sech}^6(c+d x)}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rule 457
Rule 4223
Rubi steps
\begin {align*} \int \left (a+b \text {sech}^2(c+d x)\right )^2 \tanh ^3(c+d x) \, dx &=-\frac {\text {Subst}\left (\int \frac {\left (1-x^2\right ) \left (b+a x^2\right )^2}{x^7} \, dx,x,\cosh (c+d x)\right )}{d}\\ &=-\frac {\text {Subst}\left (\int \frac {(1-x) (b+a x)^2}{x^4} \, dx,x,\cosh ^2(c+d x)\right )}{2 d}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {b^2}{x^4}+\frac {(2 a-b) b}{x^3}+\frac {a (a-2 b)}{x^2}-\frac {a^2}{x}\right ) \, dx,x,\cosh ^2(c+d x)\right )}{2 d}\\ &=\frac {a^2 \log (\cosh (c+d x))}{d}+\frac {a (a-2 b) \text {sech}^2(c+d x)}{2 d}+\frac {(2 a-b) b \text {sech}^4(c+d x)}{4 d}+\frac {b^2 \text {sech}^6(c+d x)}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.20, size = 107, normalized size = 1.39 \begin {gather*} \frac {\cosh ^4(c+d x) \left (a+b \text {sech}^2(c+d x)\right )^2 \left (12 a^2 \log (\cosh (c+d x))+6 a (a-2 b) \text {sech}^2(c+d x)+3 (2 a-b) b \text {sech}^4(c+d x)+2 b^2 \text {sech}^6(c+d x)\right )}{3 d (a+2 b+a \cosh (2 c+2 d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.42, size = 94, normalized size = 1.22
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\ln \left (\cosh \left (d x +c \right )\right )-\frac {\left (\tanh ^{2}\left (d x +c \right )\right )}{2}\right )+2 a b \left (-\frac {\sinh ^{2}\left (d x +c \right )}{2 \cosh \left (d x +c \right )^{4}}-\frac {1}{4 \cosh \left (d x +c \right )^{4}}\right )+b^{2} \left (-\frac {\sinh ^{2}\left (d x +c \right )}{4 \cosh \left (d x +c \right )^{6}}-\frac {1}{12 \cosh \left (d x +c \right )^{6}}\right )}{d}\) | \(94\) |
default | \(\frac {a^{2} \left (\ln \left (\cosh \left (d x +c \right )\right )-\frac {\left (\tanh ^{2}\left (d x +c \right )\right )}{2}\right )+2 a b \left (-\frac {\sinh ^{2}\left (d x +c \right )}{2 \cosh \left (d x +c \right )^{4}}-\frac {1}{4 \cosh \left (d x +c \right )^{4}}\right )+b^{2} \left (-\frac {\sinh ^{2}\left (d x +c \right )}{4 \cosh \left (d x +c \right )^{6}}-\frac {1}{12 \cosh \left (d x +c \right )^{6}}\right )}{d}\) | \(94\) |
risch | \(-a^{2} x -\frac {2 a^{2} c}{d}+\frac {2 \,{\mathrm e}^{2 d x +2 c} \left (3 a^{2} {\mathrm e}^{8 d x +8 c}-6 a b \,{\mathrm e}^{8 d x +8 c}+12 a^{2} {\mathrm e}^{6 d x +6 c}-12 a b \,{\mathrm e}^{6 d x +6 c}-6 b^{2} {\mathrm e}^{6 d x +6 c}+18 a^{2} {\mathrm e}^{4 d x +4 c}-12 a b \,{\mathrm e}^{4 d x +4 c}+4 b^{2} {\mathrm e}^{4 d x +4 c}+12 a^{2} {\mathrm e}^{2 d x +2 c}-12 a b \,{\mathrm e}^{2 d x +2 c}-6 b^{2} {\mathrm e}^{2 d x +2 c}+3 a^{2}-6 a b \right )}{3 d \left (1+{\mathrm e}^{2 d x +2 c}\right )^{6}}+\frac {a^{2} \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{d}\) | \(223\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 333 vs.
\(2 (71) = 142\).
time = 0.47, size = 333, normalized size = 4.32 \begin {gather*} \frac {a b \tanh \left (d x + c\right )^{4}}{2 \, d} + a^{2} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} - \frac {4}{3} \, b^{2} {\left (\frac {3 \, e^{\left (-4 \, d x - 4 \, c\right )}}{d {\left (6 \, e^{\left (-2 \, d x - 2 \, c\right )} + 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 20 \, e^{\left (-6 \, d x - 6 \, c\right )} + 15 \, e^{\left (-8 \, d x - 8 \, c\right )} + 6 \, e^{\left (-10 \, d x - 10 \, c\right )} + e^{\left (-12 \, d x - 12 \, c\right )} + 1\right )}} - \frac {2 \, e^{\left (-6 \, d x - 6 \, c\right )}}{d {\left (6 \, e^{\left (-2 \, d x - 2 \, c\right )} + 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 20 \, e^{\left (-6 \, d x - 6 \, c\right )} + 15 \, e^{\left (-8 \, d x - 8 \, c\right )} + 6 \, e^{\left (-10 \, d x - 10 \, c\right )} + e^{\left (-12 \, d x - 12 \, c\right )} + 1\right )}} + \frac {3 \, e^{\left (-8 \, d x - 8 \, c\right )}}{d {\left (6 \, e^{\left (-2 \, d x - 2 \, c\right )} + 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 20 \, e^{\left (-6 \, d x - 6 \, c\right )} + 15 \, e^{\left (-8 \, d x - 8 \, c\right )} + 6 \, e^{\left (-10 \, d x - 10 \, c\right )} + e^{\left (-12 \, d x - 12 \, c\right )} + 1\right )}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 2591 vs.
\(2 (71) = 142\).
time = 0.38, size = 2591, normalized size = 33.65 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.86, size = 129, normalized size = 1.68 \begin {gather*} \begin {cases} a^{2} x - \frac {a^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a^{2} \tanh ^{2}{\left (c + d x \right )}}{2 d} - \frac {a b \tanh ^{2}{\left (c + d x \right )} \operatorname {sech}^{2}{\left (c + d x \right )}}{2 d} - \frac {a b \operatorname {sech}^{2}{\left (c + d x \right )}}{2 d} - \frac {b^{2} \tanh ^{2}{\left (c + d x \right )} \operatorname {sech}^{4}{\left (c + d x \right )}}{6 d} - \frac {b^{2} \operatorname {sech}^{4}{\left (c + d x \right )}}{12 d} & \text {for}\: d \neq 0 \\x \left (a + b \operatorname {sech}^{2}{\left (c \right )}\right )^{2} \tanh ^{3}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 244 vs.
\(2 (71) = 142\).
time = 0.45, size = 244, normalized size = 3.17 \begin {gather*} -\frac {60 \, {\left (d x + c\right )} a^{2} - 60 \, a^{2} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {147 \, a^{2} e^{\left (12 \, d x + 12 \, c\right )} + 762 \, a^{2} e^{\left (10 \, d x + 10 \, c\right )} + 240 \, a b e^{\left (10 \, d x + 10 \, c\right )} + 1725 \, a^{2} e^{\left (8 \, d x + 8 \, c\right )} + 480 \, a b e^{\left (8 \, d x + 8 \, c\right )} + 240 \, b^{2} e^{\left (8 \, d x + 8 \, c\right )} + 2220 \, a^{2} e^{\left (6 \, d x + 6 \, c\right )} + 480 \, a b e^{\left (6 \, d x + 6 \, c\right )} - 160 \, b^{2} e^{\left (6 \, d x + 6 \, c\right )} + 1725 \, a^{2} e^{\left (4 \, d x + 4 \, c\right )} + 480 \, a b e^{\left (4 \, d x + 4 \, c\right )} + 240 \, b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 762 \, a^{2} e^{\left (2 \, d x + 2 \, c\right )} + 240 \, a b e^{\left (2 \, d x + 2 \, c\right )} + 147 \, a^{2}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{6}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.52, size = 349, normalized size = 4.53 \begin {gather*} \frac {4\,\left (2\,a\,b-9\,b^2\right )}{d\,\left (4\,{\mathrm {e}}^{2\,c+2\,d\,x}+6\,{\mathrm {e}}^{4\,c+4\,d\,x}+4\,{\mathrm {e}}^{6\,c+6\,d\,x}+{\mathrm {e}}^{8\,c+8\,d\,x}+1\right )}-\frac {32\,b^2}{3\,d\,\left (6\,{\mathrm {e}}^{2\,c+2\,d\,x}+15\,{\mathrm {e}}^{4\,c+4\,d\,x}+20\,{\mathrm {e}}^{6\,c+6\,d\,x}+15\,{\mathrm {e}}^{8\,c+8\,d\,x}+6\,{\mathrm {e}}^{10\,c+10\,d\,x}+{\mathrm {e}}^{12\,c+12\,d\,x}+1\right )}-\frac {2\,\left (a^2-6\,a\,b+2\,b^2\right )}{d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )}-\frac {2\,\left (2\,a\,b-a^2\right )}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}-\frac {8\,\left (6\,a\,b-7\,b^2\right )}{3\,d\,\left (3\,{\mathrm {e}}^{2\,c+2\,d\,x}+3\,{\mathrm {e}}^{4\,c+4\,d\,x}+{\mathrm {e}}^{6\,c+6\,d\,x}+1\right )}-a^2\,x+\frac {a^2\,\ln \left ({\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+1\right )}{d}+\frac {32\,b^2}{d\,\left (5\,{\mathrm {e}}^{2\,c+2\,d\,x}+10\,{\mathrm {e}}^{4\,c+4\,d\,x}+10\,{\mathrm {e}}^{6\,c+6\,d\,x}+5\,{\mathrm {e}}^{8\,c+8\,d\,x}+{\mathrm {e}}^{10\,c+10\,d\,x}+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________